load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "utilccl",
    srcs = [
        "builtins.go",
        "license_check.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/utilccl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/utilccl/licenseccl",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/builtins/builtinsregistry",
        "//pkg/sql/sem/tree",
        "//pkg/util/envutil",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "utilccl_test",
    size = "small",
    srcs = [
        "license_check_test.go",
        "license_test.go",
        "main_test.go",
    ],
    embed = [":utilccl"],
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/ccl/utilccl/licenseccl",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/testutils",
        "//pkg/util/envutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_stretchr_testify//require",
    ],
)
